from flask import Flask

from flask import request

app = Flask(__name__)
app.debug = True


@app.route("/")
def index():
    user_agent = request.headers.get('User-Agent')
    return 'Your browser is%s' % user_agent


@app.route("/a")
def p():
    return 'hi'


# path类型与string类型区别是，path不会把/当作分割符
@app.route('/user/<path:name>')
def user(name):
    return 'Hello,%s!' % name



if __name__ == '__main__':
    print(app.url_map)
    app.run()
